﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace FrogEngine
{
	public struct LineSegment : IPrimitive
	{
		public LineSegment(Vector3 l1, Vector3 l2)
		{
			this.l1 = l1;
			this.l2 = l2;
		}

		public IEnumerable<Vector3> Points { get { return new Vector3[] { l1, l2 }; } }

		private Vector3 l1;
		public Vector3 L1
		{
			get { return l1; }
			set { l1 = value; }
		}

		private Vector3 l2;
		public Vector3 L2
		{
			get { return l2; }
			set { l2 = value; }
		}

		public Vector3 Direction
		{
			get { return Vector3.Normalize(l2 - l1); }
		}

		public float Length
		{
			get { return Vector3.Distance(L1, L2); }
		}
	}
}
